<?php

namespace YouBaoLian\Application\Info;

class PersonInfo extends Info
{
    private $name = '';

    private $mobile = '';

    private $idType = 0;

    private $idCard = '';

    private $address = '';

    private $email = '';

    private $idCardStartDate = '';

    private $idCardEndDate = '2099-12-31';

    private $idCardIssuingAgency = '';

    private $nation = '';

    private $linkManCertificateNo = '';

    private $linkManCertificateTypeCode = 0;

    private $linkManName = '';

    private $organizationType = '';

    private $phoneExchange = '';

    public function getInfo(): array
    {
        $data = [
            'name' => $this->name,
            'mobile' => $this->mobile,
            'idType' => $this->idType,
            'idCard' => $this->idCard,
            'address' => $this->address,
            'email' => $this->email,
            'idCardStartDate' => $this->idCardStartDate,
            'idCardEndDate' => $this->idCardEndDate,
        ];

        if ($this->idCardIssuingAgency) {
            $data['idCardIssuingAgency'] = $this->idCardIssuingAgency;
        }
        if ($this->nation) {
            $data['nation'] = $this->nation;
        }

        if ($this->linkManCertificateTypeCode) {
            $data['linkManCertificateTypeCode'] = $this->linkManCertificateTypeCode;
            $data['linkManName'] = $this->linkManName;
            $data['organizationType'] = $this->organizationType;
            $data['phoneExchange'] = $this->phoneExchange;
        }

        return $data;
    }

    /**
     * @param string $name
     */
    public function setName(string $name): void
    {
        $this->name = $name;
    }

    /**
     * @param string $mobile
     */
    public function setMobile(string $mobile): void
    {
        $this->mobile = $mobile;
    }

    /**
     * @param int $idType
     */
    public function setIdType(int $idType): void
    {
        $this->idType = $idType;
    }

    /**
     * @param string $idCard
     */
    public function setIdCard(string $idCard): void
    {
        $this->idCard = $idCard;
    }

    /**
     * @param string $address
     */
    public function setAddress(string $address): void
    {
        $this->address = $address;
    }

    /**
     * @param string $email
     */
    public function setEmail(string $email): void
    {
        $this->email = $email;
    }

    /**
     * @param string $idCardStartDate
     */
    public function setIdCardStartDate(string $idCardStartDate): void
    {
        $this->idCardStartDate = $idCardStartDate;
    }

    /**
     * @param string $idCardEndDate
     */
    public function setIdCardEndDate(string $idCardEndDate): void
    {
        $this->idCardEndDate = $idCardEndDate;
    }

    /**
     * @param string $idCardIssuingAgency
     */
    public function setIdCardIssuingAgency(string $idCardIssuingAgency): void
    {
        $this->idCardIssuingAgency = $idCardIssuingAgency;
    }

    /**
     * @param string $nation
     */
    public function setNation(string $nation): void
    {
        $this->nation = $nation;
    }

    /**
     * @param string $linkManCertificateNo
     */
    public function setLinkManCertificateNo(string $linkManCertificateNo): void
    {
        $this->linkManCertificateNo = $linkManCertificateNo;
    }

    /**
     * @param int $linkManCertificateTypeCode
     */
    public function setLinkManCertificateTypeCode(int $linkManCertificateTypeCode): void
    {
        $this->linkManCertificateTypeCode = $linkManCertificateTypeCode;
    }

    /**
     * @param string $linkManName
     */
    public function setLinkManName(string $linkManName): void
    {
        $this->linkManName = $linkManName;
    }

    /**
     * @param string $organizationType
     */
    public function setOrganizationType(string $organizationType): void
    {
        $this->organizationType = $organizationType;
    }

    /**
     * @param string $phoneExchange
     */
    public function setPhoneExchange(string $phoneExchange): void
    {
        $this->phoneExchange = $phoneExchange;
    }
}